# coding:utf-8
import sys;sys.path.append("..")
import requests
import re
import argparse


def upload(url,file_name,data,file_path,file_upload_name=".config.php",headers="",content_type="image/jpeg"):

    file={
        file_name: (file_upload_name, open(file_path, "rb") , content_type),
    }
    if headers=="":
        req=requests.post(url, data, files=file)
    else:
        req=requests.post(url, data, files=file,headers=headers)

    return  req




if __name__=="__main__":

    parser = argparse.ArgumentParser()
    parser.add_argument("model", help="Select model. headers,post,upload",
                        action="store",choices=["headers","post","upload","h","p","u"])
    parser.add_argument("-f", "--file", help="Read string from file.",
                        action="store")
    args = parser.parse_args()

    if(args.model == "upload"):
        pass

